package com.itheima.app.controller;


import com.itheima.app.manager.MakeFriendManager;
import com.itheima.vo.UserAudioVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.Map;

@RestController
public class SoundController {
    @Autowired
    private MakeFriendManager makeFriendManager;
    //桃花传音 - 发送语音
    @PostMapping("/peachblossom")
    public Map sendAudio(MultipartFile soundFile) throws IOException {
        return makeFriendManager.sendAudio(soundFile);
    }

    //桃花传音 - 播放语音
    @GetMapping("/peachblossom")
    public UserAudioVo findAudiio() {

        return makeFriendManager.findAudio();

    }

}
